import axios from 'axios'
import Vue from 'vue'

export default {
  namespaced: true,
  state: () => ({
    artCateList: []
  }),
  mutations: {
    updateArtCateList (state, data) {
      state.artCateList = data
    }
  },
  actions: {
    async getArtCateList (ctx) {
      const { data: res } = await axios.get('/my/cate/list')
      //   console.log(res)
      if (res.code !== 0) return Vue.prototype.$message.error(res.message)
      Vue.prototype.$message.success(res.message)
      ctx.commit('updateArtCateList', res.data)
    }
  }
}
